exports.toExamineFeedback = (req, res) => {

    var bodyParams = req.routeInfo.bodyParams;

    var resultData = {};

    var feedbackInfo = 0;

    //查询该反馈的信息
    function searchThisFeedback(cb) {

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.artSalesQuestionSearch.Request_Api_Url + "/sq_id/" + bodyParams.sq_id,
                method: 'GET',
            },
            function (data) {

                feedbackInfo = data.result.data;

                cb();

            }
        )
    }

    //更新反馈申请状态
    function updateFeedback(cb) {
        var param = {
            update_where: bodyParams.update_where,
            sq_id: bodyParams.sq_id,
            sq_apply_knowledge_status: bodyParams.sq_apply_knowledge_status,
        };

        R.SEND_HTTP(
            req,
            res,
            {
                url: CORE_APIConfig.coreAPI.artSalesQuestionUpdate.Request_Api_Url,
                method: 'POST',
                data: param
            },
            function (data) {

                console.log(data.result);

                cb();
            }
        )
    }

    //根据审核状态进行操作
    function baseApplyStatusHandel(cb) {

        if (bodyParams.sq_apply_knowledge_status == 2) {
            //同意--将反馈信息的内容存入知识库
            var param = {
                sk_title: feedbackInfo[0].sq_content,
                sk_type: feedbackInfo[0].sq_type,
                sk_create_time: Date.parse(new Date()) / 1000,
                sk_content: feedbackInfo[0].sq_reply,
                sk_author: feedbackInfo[0].sq_reply_nickname,
                sk_category: 1,
            };

            R.SEND_HTTP(
                req,
                res,
                {
                    url: CORE_APIConfig.coreAPI.artSalesKnowledgeAdd.Request_Api_Url,
                    method: 'POST',
                    data: param
                },
                function (data) {

                    resultData.addResult = data.result;

                    cb();
                }
            )
        } else {

            cb()
        }
    }

    F.Serial([
        searchThisFeedback,
        updateFeedback,
        baseApplyStatusHandel,
    ], () => {
        RES.successResponse(res, resultData);
    })


}